function Popup()
{
	
	this._data = null;
	$(document).ready(this.init);
}

function init()
{
	$('<style type="text/css">.popup{display:none;border:solid 1px #000;position:absolute;top:300px;left:350px;background:#aaa;color:white;font-weight:bold;padding:15px;margin:0 auto;z-index:1;}</style>').prependTo('body');
	$("<div id='dvAskYesNo' class='popup'/>").html(
		"<label id='lblAskMessage'/><input id='btnAskYes' type='button' value='yes'/><input id='btnAskNo' type='button' value='no'/>").prependTo('body');
}
Popup.prototype.init = init;

function show(message,callback,data)
{
	this._data = data;
	$("#lblAskMessage").attr('innerHTML',message);
	$("#btnAskYes").bind("click",function() { _popup.hide(); callback(true,data); });
	$("#btnAskNo").bind("click",function() { _popup.hide(); callback(false,data); });
	$("#dvAskYesNo").fadeIn('fast');
}
Popup.prototype.show = show;

function hide()
{
	this._data = null;
	$("#dvAskYesNo").hide();
}
Popup.prototype.hide = hide;

var _popup = new Popup();
